package com.example.myspringboot.web.dameng;

import com.example.myspringboot.dao.jpa.DaMengJpaTestDao;
import com.example.myspringboot.entity.DaMengJpaTest;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author cy
 * @date 2024/7/24
 */
@RestController
@RequiredArgsConstructor
@Slf4j
public class DamengJpaWeb {

    private final DaMengJpaTestDao daMengJpaTestDao;

    @RequestMapping("/dameng/jpa/test/add")
    public String add() {


        DaMengJpaTest jpaTest = new DaMengJpaTest();
        jpaTest.setName("张三");
        jpaTest.setAddress("1234");
        daMengJpaTestDao.save(jpaTest);


        return "OK";
    }
}
